package f_facade.a_origin;

/**
 * Created by wug on 2016/7/1 0001.
 */
public class Car {
    Electricity electricity;
    CarAirCondition carAirCondition;

    private String name = "汽车";

    public void lockTurn2ACC() {
        electricity = new Electricity();
        electricity.setOn(true);
        carAirCondition = new CarAirCondition();
        carAirCondition.powOn(electricity);
    }

    public void run() {
        System.out.println(name + "行驶！");
    }

    public void openOutsideLoop() {
        System.out.println(name + "打开外循环！");
    }

    public void closeOutsideLoop() {
        System.out.println(name + "关闭外循环！");
    }

    public void openAirConditioning() {
        System.out.println(name + "打开空调");
        carAirCondition.detectRoomTemp(35);
        carAirCondition.adjustTemp(28);
        carAirCondition.run();
    }

    public void closeAirConditoning() {
        System.out.println(name + "关闭空调");
        electricity.setOn(false);
    }

    public void adjustAirConditioning(int temp) {
        System.out.println(name + "调节空调温度");
        carAirCondition.adjustTemp(temp);
    }

    public void lockTheCar() {
        System.out.println("锁车");
    }
}
